package openbang.account.service.vo;

/**
 * 帐户管理
 * 
 * 调用后台服务的一些返回值的状态定义
 * 
 * @author aibo zeng
 *
 */

public enum AccountServiceEnum {
	OK (0,"成功"),
	ERR_EMAIL(1,"帐户不存在"),
	ERR_PWD(2,"密码不对"),
	EXIST_EMAIL(3,"帐户已经存在"),
	ERR_FINDPWD(4,"非本站管理,不能找回密码"), //google共用的不能找回
	ERR_FINDPWD_APPLY(5,"无效的申请ID"),
	ERR_NO_VERIFY_EMAIL(6,"邮箱没有验证"),
	
	ERR_OTHER(99,"其他错误");

	private Integer code;
	private String desc;
	
	private AccountServiceEnum(Integer code,String desc) {
		this.code = code;
		this.desc = desc;
	}
	public int getCode() {
		return code;
	}
	public String getDesc(){
		return desc;
	}
	
	public static String getDesc(Integer code) {
		for(AccountServiceEnum each : AccountServiceEnum.values()) {
			if(each.getCode()==code)
				return each.getDesc();
		}		
		return "";
	}
}
